package com.eks.excel.vo;

import cn.gjing.tools.excel.Excel;
import cn.gjing.tools.excel.ExcelField;
import lombok.*;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * MultiHead
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2021-01-15 16:03
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
@Excel("多级表头")
public class MultiHead {
    @ExcelField({"用户名","用户名"})
    private String userName;

    @ExcelField({"年龄","年龄"})
    private Integer age;

    @ExcelField({"形态","身高"})
    private BigDecimal height;

    @ExcelField({"形态","体重"})
    private BigDecimal weight;

    public static MultiHead getSingleHead(){
        return MultiHead.builder()
                .userName("张三")
                .age(22)
                .height(new BigDecimal(1.2))
                .weight(new BigDecimal(2.3))
                .build();
    }

    public static List<MultiHead> getMultiHeadList(){
        List<MultiHead> list = new ArrayList<>();
        list.add(MultiHead.builder()
                .userName("张三")
                .age(22)
                .height(new BigDecimal(1.2))
                .weight(new BigDecimal(2.3))
                .build());
        list.add(MultiHead.builder()
                .userName("李四")
                .age(20)
                .height(new BigDecimal(51.2))
                .weight(new BigDecimal(52.3))
                .build());
        return list;
    }
}
